package com.example.rocketmqpublisher.consumer;

import lombok.extern.log4j.Log4j2;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @Author wy
 * @Description TODO
 * @Date 2024/2/26 17:13
 * @Version 1.0
 */
@Log4j2
@Component
@RocketMQMessageListener(topic ="mailTopic", consumerGroup = "consumer-01",selectorExpression = "*")
public class MailTopicConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
       log.info("线程"+Thread.currentThread().getId()+",收到消息:"+message);
    }
}
